import request from '../../utils/request'
import { NEWS_GET } from '../constants'
export const newsGet = (id) => {
  return async (dispatch) => {
    const { data } = await request.get(
      `articles?channel_id=${id}&timestamp={Date.now()}`
    )
    dispatch({
      type: NEWS_GET,
      payload: data.data.results,
    })
    // return data.data.results
  }
}
